package vesion2.tool;

import vesion2.barrier.*;
import vesion2.object.Point;

import javax.swing.*;
import java.util.ArrayList;
import java.util.Vector;

public class LoadDefaultData {
    public static void initFBrick(ArrayList<Brick> barriers, Point point){
        barriers.add(new Brick(point));
        barriers.add(new Brick(new Point(point.getX()+40,point.getY())));
        barriers.add(new Brick(new Point(point.getX(),point.getY()+40)));
        barriers.add(new Brick(new Point(point.getX()+40,point.getY()+40)));
    }
    public static void initBrick(ArrayList<Brick> barriers,Point point){
        barriers.add(new Brick(point));
        barriers.add(new Brick(new Point(point.getX(),point.getY()+40)));
    }

    public static void initFDBrick(ArrayList<Brick> barriers,Point point){
        initFBrick(barriers,point);
        initFBrick(barriers,new Point(900- point.getX()-80,point.getY()));
    }

    public static void initHome(Vector<Barrier> barriers,Point point,int type){
        barriers.add(new Iron(point,21,21));
        barriers.add(new ProtectLimit(new Point(point.getX()+20,point.getY()),51,21,type));
        barriers.add(new Iron(new Point(point.getX()+70, point.getY()),21,21));
        barriers.add(new ProtectLimit(new Point(point.getX(),point.getY()+20),21,51,type));
        barriers.add(new ProtectLimit(new Point(point.getX()+70,point.getY()+20),21,51,type));
        barriers.add(new Iron(new Point(point.getX(),point.getY()+70),21,21));
        barriers.add(new ProtectLimit(new Point(point.getX()+20,point.getY()+70),51,21,type));
        barriers.add(new Iron(new Point(point.getX()+70, point.getY()+70),21,21));
    }

    public static void initDHome(Vector<Barrier> barriers,Point point,int type){
        initHome(barriers,point,type);
        initHome(barriers,new Point(900-point.getX()-90,point.getY()),type);
    }

    public static void initDIron(ArrayList<Iron> barriers, Point point, int width, int height){
        barriers.add(new Iron(point,width,height));
        barriers.add(new Iron(new Point(900- point.getX()-width,point.getY()),width,height));
    }

    public static void initDWater(ArrayList<Water> barriers,Point point,int width,int height){
        barriers.add(new Water(point,width,height));
        barriers.add(new Water(new Point(900-point.getX()-width,point.getY()),width,height));
    }

    public static void initKing(Vector<Barrier> barriers){
        //上
        barriers.add(new Brick(new Point(390,590),20,20));
        barriers.add(new Brick(new Point(410,590),20,20));
        barriers.add(new Brick(new Point(430,590),20,20));
        barriers.add(new Brick(new Point(450,590),20,20));
        barriers.add(new Brick(new Point(470,590),20,20));
        barriers.add(new Brick(new Point(490,590),20,20));
        //左
        barriers.add(new Brick(new Point(390,610),20,20));
        barriers.add(new Brick(new Point(390,630),20,20));
        barriers.add(new Brick(new Point(390,650),20,20));
        barriers.add(new Brick(new Point(390,670),20,20));

        //右
        barriers.add(new Brick(new Point(490,610),20,20));
        barriers.add(new Brick(new Point(490,630),20,20));
        barriers.add(new Brick(new Point(490,650),20,20));
        barriers.add(new Brick(new Point(490,670),20,20));
    }
}
